package tools;

import java.util.StringTokenizer;

public class Parser {

	public static  String parsear(String toParse, String operator){		    	     
        StringTokenizer tokens = new StringTokenizer(toParse);
        String parcial = "";
        int j = 1;
        int m = tokens.countTokens();
        while(tokens.hasMoreTokens() && j<m){
            parcial += tokens.nextToken()+" ";
            j++;
        }
        parcial += tokens.nextToken();
        String p2=parcial.trim();
        p2 = parcial.replace(" ", " "+operator+" ");
        return p2;
}

}
